using System;
using System.Net;
using Microsoft.Coding4Fun.TweetCraft.Tray.Support;

namespace Microsoft.Coding4Fun.TweetCraft.Tests.Support.Mocks
{
    /// <summary>
	/// Mock DownloadManager class.
	/// </summary>
	internal class MockDownloadManager : DownloadManager
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="MockDownloadManager"/> class.
		/// </summary>
		/// <param name="contentToDownload">The content to download.</param>
		public MockDownloadManager(string contentToDownload)
		{
			ContentToDownload = contentToDownload;
		}

		/// <summary>
		/// Gets or sets the content to download.
		/// </summary>
		/// <value>The content to download.</value>
		public string ContentToDownload { private get; set; }

		/// <summary>
		/// Creates the web request.
		/// </summary>
		/// <param name="uri">The URI.</param>
		/// <returns></returns>
		protected override WebRequest CreateWebRequest(Uri uri)
		{
			return new MockRequest(uri, ContentToDownload);
		}

	}
}